home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / include / linux / ethtool.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-12-24  |  20.3 KB  |  580 lines

  1. /*
  2.  * ethtool.h: Defines for Linux ethtool.
  3.  *
  4.  * Copyright (C) 1998 David S. Miller (davem@redhat.com)
  5.  * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
  6.  * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
  7.  * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
  8.  *                                christopher.leech@intel.com,
  9.  *                                scott.feldman@intel.com)
  10.  */
  11.  
  12. #ifndef _LINUX_ETHTOOL_H
  13. #define _LINUX_ETHTOOL_H
  14.  
  15. #include <linux/types.h>
  16.  
  17. /* This should work for both 32 and 64 bit userland. */
  18. struct ethtool_cmd {
  19.     __u32    cmd;
  20.     __u32    supported;    /* Features this interface supports */
  21.     __u32    advertising;    /* Features this interface advertises */
  22.     __u16    speed;        /* The forced speed, 10Mb, 100Mb, gigabit */
  23.     __u8    duplex;        /* Duplex, half or full */
  24.     __u8    port;        /* Which connector port */
  25.     __u8    phy_address;
  26.     __u8    transceiver;    /* Which transceiver to use */
  27.     __u8    autoneg;    /* Enable or disable autonegotiation */
  28.     __u32    maxtxpkt;    /* Tx pkts before generating tx int */
  29.     __u32    maxrxpkt;    /* Rx pkts before generating rx int */
  30.     __u16    speed_hi;
  31.     __u16    reserved2;
  32.     __u32    reserved[3];
  33. };
  34.  
  35. static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
  36.                         __u32 speed)
  37. {
  38.  
  39.     ep->speed = (__u16)speed;
  40.     ep->speed_hi = (__u16)(speed >> 16);
  41. }
  42.  
  43. static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
  44. {
  45.     return (ep->speed_hi << 16) | ep->speed;
  46. }
  47.  
  48. #define ETHTOOL_BUSINFO_LEN    32
  49. /* these strings are set to whatever the driver author decides... */
  50. struct ethtool_drvinfo {
  51.     __u32    cmd;
  52.     char    driver[32];    /* driver short name, "tulip", "eepro100" */
  53.     char    version[32];    /* driver version string */
  54.     char    fw_version[32];    /* firmware version string, if applicable */
  55.     char    bus_info[ETHTOOL_BUSINFO_LEN];    /* Bus info for this IF. */
  56.                 /* For PCI devices, use pci_name(pci_dev). */
  57.     char    reserved1[32];
  58.     char    reserved2[12];
  59.     __u32    n_priv_flags;    /* number of flags valid in ETHTOOL_GPFLAGS */
  60.     __u32    n_stats;    /* number of u64's from ETHTOOL_GSTATS */
  61.     __u32    testinfo_len;
  62.     __u32    eedump_len;    /* Size of data from ETHTOOL_GEEPROM (bytes) */
  63.     __u32    regdump_len;    /* Size of data from ETHTOOL_GREGS (bytes) */
  64. };
  65.  
  66. #define SOPASS_MAX    6
  67. /* wake-on-lan settings */
  68. struct ethtool_wolinfo {
  69.     __u32    cmd;
  70.     __u32    supported;
  71.     __u32    wolopts;
  72.     __u8    sopass[SOPASS_MAX]; /* SecureOn(tm) password */
  73. };
  74.  
  75. /* for passing single values */
  76. struct ethtool_value {
  77.     __u32    cmd;
  78.     __u32    data;
  79. };
  80.  
  81. /* for passing big chunks of data */
  82. struct ethtool_regs {
  83.     __u32    cmd;
  84.     __u32    version; /* driver-specific, indicates different chips/revs */
  85.     __u32    len; /* bytes */
  86.     __u8    data[0];
  87. };
  88.  
  89. /* for passing EEPROM chunks */
  90. struct ethtool_eeprom {
  91.     __u32    cmd;
  92.     __u32    magic;
  93.     __u32    offset; /* in bytes */
  94.     __u32    len; /* in bytes */
  95.     __u8    data[0];
  96. };
  97.  
  98. /* for configuring coalescing parameters of chip */
  99. struct ethtool_coalesce {
  100.     __u32    cmd;    /* ETHTOOL_{G,S}COALESCE */
  101.  
  102.     /* How many usecs to delay an RX interrupt after
  103.      * a packet arrives.  If 0, only rx_max_coalesced_frames
  104.      * is used.
  105.      */
  106.     __u32    rx_coalesce_usecs;
  107.  
  108.     /* How many packets to delay an RX interrupt after
  109.      * a packet arrives.  If 0, only rx_coalesce_usecs is
  110.      * used.  It is illegal to set both usecs and max frames
  111.      * to zero as this would cause RX interrupts to never be
  112.      * generated.
  113.      */
  114.     __u32    rx_max_coalesced_frames;
  115.  
  116.     /* Same as above two parameters, except that these values
  117.      * apply while an IRQ is being serviced by the host.  Not
  118.      * all cards support this feature and the values are ignored
  119.      * in that case.
  120.      */
  121.     __u32    rx_coalesce_usecs_irq;
  122.     __u32    rx_max_coalesced_frames_irq;
  123.  
  124.     /* How many usecs to delay a TX interrupt after
  125.      * a packet is sent.  If 0, only tx_max_coalesced_frames
  126.      * is used.
  127.      */
  128.     __u32    tx_coalesce_usecs;
  129.  
  130.     /* How many packets to delay a TX interrupt after
  131.      * a packet is sent.  If 0, only tx_coalesce_usecs is
  132.      * used.  It is illegal to set both usecs and max frames
  133.      * to zero as this would cause TX interrupts to never be
  134.      * generated.
  135.      */
  136.     __u32    tx_max_coalesced_frames;
  137.  
  138.     /* Same as above two parameters, except that these values
  139.      * apply while an IRQ is being serviced by the host.  Not
  140.      * all cards support this feature and the values are ignored
  141.      * in that case.
  142.      */
  143.     __u32    tx_coalesce_usecs_irq;
  144.     __u32    tx_max_coalesced_frames_irq;
  145.  
  146.     /* How many usecs to delay in-memory statistics
  147.      * block updates.  Some drivers do not have an in-memory
  148.      * statistic block, and in such cases this value is ignored.
  149.      * This value must not be zero.
  150.      */
  151.     __u32    stats_block_coalesce_usecs;
  152.  
  153.     /* Adaptive RX/TX coalescing is an algorithm implemented by
  154.      * some drivers to improve latency under low packet rates and
  155.      * improve throughput under high packet rates.  Some drivers
  156.      * only implement one of RX or TX adaptive coalescing.  Anything
  157.      * not implemented by the driver causes these values to be
  158.      * silently ignored.
  159.      */
  160.     __u32    use_adaptive_rx_coalesce;
  161.     __u32    use_adaptive_tx_coalesce;
  162.  
  163.     /* When the packet rate (measured in packets per second)
  164.      * is below pkt_rate_low, the {rx,tx}_*_low parameters are
  165.      * used.
  166.      */
  167.     __u32    pkt_rate_low;
  168.     __u32    rx_coalesce_usecs_low;
  169.     __u32    rx_max_coalesced_frames_low;
  170.     __u32    tx_coalesce_usecs_low;
  171.     __u32    tx_max_coalesced_frames_low;
  172.  
  173.     /* When the packet rate is below pkt_rate_high but above
  174.      * pkt_rate_low (both measured in packets per second) the
  175.      * normal {rx,tx}_* coalescing parameters are used.
  176.      */
  177.  
  178.     /* When the packet rate is (measured in packets per second)
  179.      * is above pkt_rate_high, the {rx,tx}_*_high parameters are
  180.      * used.
  181.      */
  182.     __u32    pkt_rate_high;
  183.     __u32    rx_coalesce_usecs_high;
  184.     __u32    rx_max_coalesced_frames_high;
  185.     __u32    tx_coalesce_usecs_high;
  186.     __u32    tx_max_coalesced_frames_high;
  187.  
  188.     /* How often to do adaptive coalescing packet rate sampling,
  189.      * measured in seconds.  Must not be zero.
  190.      */
  191.     __u32    rate_sample_interval;
  192. };
  193.  
  194. /* for configuring RX/TX ring parameters */
  195. struct ethtool_ringparam {
  196.     __u32    cmd;    /* ETHTOOL_{G,S}RINGPARAM */
  197.  
  198.     /* Read only attributes.  These indicate the maximum number
  199.      * of pending RX/TX ring entries the driver will allow the
  200.      * user to set.
  201.      */
  202.     __u32    rx_max_pending;
  203.     __u32    rx_mini_max_pending;
  204.     __u32    rx_jumbo_max_pending;
  205.     __u32    tx_max_pending;
  206.  
  207.     /* Values changeable by the user.  The valid values are
  208.      * in the range 1 to the "*_max_pending" counterpart above.
  209.      */
  210.     __u32    rx_pending;
  211.     __u32    rx_mini_pending;
  212.     __u32    rx_jumbo_pending;
  213.     __u32    tx_pending;
  214. };
  215.  
  216. /* for configuring link flow control parameters */
  217. struct ethtool_pauseparam {
  218.     __u32    cmd;    /* ETHTOOL_{G,S}PAUSEPARAM */
  219.  
  220.     /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
  221.      * being true) the user may set 'autonet' here non-zero to have the
  222.      * pause parameters be auto-negotiated too.  In such a case, the
  223.      * {rx,tx}_pause values below determine what capabilities are
  224.      * advertised.
  225.      *
  226.      * If 'autoneg' is zero or the link is not being auto-negotiated,
  227.      * then {rx,tx}_pause force the driver to use/not-use pause
  228.      * flow control.
  229.      */
  230.     __u32    autoneg;
  231.     __u32    rx_pause;
  232.     __u32    tx_pause;
  233. };
  234.  
  235. #define ETH_GSTRING_LEN        32
  236. enum ethtool_stringset {
  237.     ETH_SS_TEST        = 0,
  238.     ETH_SS_STATS,
  239.     ETH_SS_PRIV_FLAGS,
  240. };
  241.  
  242. /* for passing string sets for data tagging */
  243. struct ethtool_gstrings {
  244.     __u32    cmd;        /* ETHTOOL_GSTRINGS */
  245.     __u32    string_set;    /* string set id e.c. ETH_SS_TEST, etc*/
  246.     __u32    len;        /* number of strings in the string set */
  247.     __u8    data[0];
  248. };
  249.  
  250. enum ethtool_test_flags {
  251.     ETH_TEST_FL_OFFLINE    = (1 << 0),    /* online / offline */
  252.     ETH_TEST_FL_FAILED    = (1 << 1),    /* test passed / failed */
  253. };
  254.  
  255. /* for requesting NIC test and getting results*/
  256. struct ethtool_test {
  257.     __u32    cmd;        /* ETHTOOL_TEST */
  258.     __u32    flags;        /* ETH_TEST_FL_xxx */
  259.     __u32    reserved;
  260.     __u32    len;        /* result length, in number of u64 elements */
  261.     __u64    data[0];
  262. };
  263.  
  264. /* for dumping NIC-specific statistics */
  265. struct ethtool_stats {
  266.     __u32    cmd;        /* ETHTOOL_GSTATS */
  267.     __u32    n_stats;    /* number of u64's being returned */
  268.     __u64    data[0];
  269. };
  270.  
  271. struct ethtool_perm_addr {
  272.     __u32    cmd;        /* ETHTOOL_GPERMADDR */
  273.     __u32    size;
  274.     __u8    data[0];
  275. };
  276.  
  277. /* boolean flags controlling per-interface behavior characteristics.
  278.  * When reading, the flag indicates whether or not a certain behavior
  279.  * is enabled/present.  When writing, the flag indicates whether
  280.  * or not the driver should turn on (set) or off (clear) a behavior.
  281.  *
  282.  * Some behaviors may read-only (unconditionally absent or present).
  283.  * If such is the case, return EINVAL in the set-flags operation if the
  284.  * flag differs from the read-only value.
  285.  */
  286. enum ethtool_flags {
  287.     ETH_FLAG_LRO        = (1 << 15),    /* LRO is enabled */
  288. };
  289.  
  290. struct ethtool_rxnfc {
  291.     __u32        cmd;
  292.     __u32        flow_type;
  293.     __u64        data;
  294. };
  295.  
  296. #ifdef __KERNEL__
  297.  
  298. struct net_device;
  299.  
  300. /* Some generic methods drivers may use in their ethtool_ops */
  301. u32 ethtool_op_get_link(struct net_device *dev);
  302. u32 ethtool_op_get_tx_csum(struct net_device *dev);
  303. int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
  304. int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
  305. int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data);
  306. u32 ethtool_op_get_sg(struct net_device *dev);
  307. int ethtool_op_set_sg(struct net_device *dev, u32 data);
  308. u32 ethtool_op_get_tso(struct net_device *dev);
  309. int ethtool_op_set_tso(struct net_device *dev, u32 data);
  310. u32 ethtool_op_get_ufo(struct net_device *dev);
  311. int ethtool_op_set_ufo(struct net_device *dev, u32 data);
  312. u32 ethtool_op_get_flags(struct net_device *dev);
  313. int ethtool_op_set_flags(struct net_device *dev, u32 data);
  314.  
  315. /**
  316.  * ðtool_ops - Alter and report network device settings
  317.  * get_settings: Get device-specific settings
  318.  * set_settings: Set device-specific settings
  319.  * get_drvinfo: Report driver information
  320.  * get_regs: Get device registers
  321.  * get_wol: Report whether Wake-on-Lan is enabled
  322.  * set_wol: Turn Wake-on-Lan on or off
  323.  * get_msglevel: Report driver message level
  324.  * set_msglevel: Set driver message level
  325.  * nway_reset: Restart autonegotiation
  326.  * get_link: Get link status
  327.  * get_eeprom: Read data from the device EEPROM
  328.  * set_eeprom: Write data to the device EEPROM
  329.  * get_coalesce: Get interrupt coalescing parameters
  330.  * set_coalesce: Set interrupt coalescing parameters
  331.  * get_ringparam: Report ring sizes
  332.  * set_ringparam: Set ring sizes
  333.  * get_pauseparam: Report pause parameters
  334.  * set_pauseparam: Set pause parameters
  335.  * get_rx_csum: Report whether receive checksums are turned on or off
  336.  * set_rx_csum: Turn receive checksum on or off
  337.  * get_tx_csum: Report whether transmit checksums are turned on or off
  338.  * set_tx_csum: Turn transmit checksums on or off
  339.  * get_sg: Report whether scatter-gather is enabled
  340.  * set_sg: Turn scatter-gather on or off
  341.  * get_tso: Report whether TCP segmentation offload is enabled
  342.  * set_tso: Turn TCP segmentation offload on or off
  343.  * get_ufo: Report whether UDP fragmentation offload is enabled
  344.  * set_ufo: Turn UDP fragmentation offload on or off
  345.  * self_test: Run specified self-tests
  346.  * get_strings: Return a set of strings that describe the requested objects 
  347.  * phys_id: Identify the device
  348.  * get_stats: Return statistics about the device
  349.  * get_flags: get 32-bit flags bitmap
  350.  * set_flags: set 32-bit flags bitmap
  351.  * 
  352.  * Description:
  353.  *
  354.  * get_settings:
  355.  *    @get_settings is passed an ðtool_cmd to fill in.  It returns
  356.  *    an negative errno or zero.
  357.  *
  358.  * set_settings:
  359.  *    @set_settings is passed an ðtool_cmd and should attempt to set
  360.  *    all the settings this device supports.  It may return an error value
  361.  *    if something goes wrong (otherwise 0).
  362.  *
  363.  * get_eeprom:
  364.  *    Should fill in the magic field.  Don't need to check len for zero
  365.  *    or wraparound.  Fill in the data argument with the eeprom values
  366.  *    from offset to offset + len.  Update len to the amount read.
  367.  *    Returns an error or zero.
  368.  *
  369.  * set_eeprom:
  370.  *    Should validate the magic field.  Don't need to check len for zero
  371.  *    or wraparound.  Update len to the amount written.  Returns an error
  372.  *    or zero.
  373.  */
  374. struct ethtool_ops {
  375.     int    (*get_settings)(struct net_device *, struct ethtool_cmd *);
  376.     int    (*set_settings)(struct net_device *, struct ethtool_cmd *);
  377.     void    (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
  378.     int    (*get_regs_len)(struct net_device *);
  379.     void    (*get_regs)(struct net_device *, struct ethtool_regs *, void *);
  380.     void    (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
  381.     int    (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
  382.     u32    (*get_msglevel)(struct net_device *);
  383.     void    (*set_msglevel)(struct net_device *, u32);
  384.     int    (*nway_reset)(struct net_device *);
  385.     u32    (*get_link)(struct net_device *);
  386.     int    (*get_eeprom_len)(struct net_device *);
  387.     int    (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
  388.     int    (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
  389.     int    (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
  390.     int    (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
  391.     void    (*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
  392.     int    (*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
  393.     void    (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
  394.     int    (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
  395.     u32    (*get_rx_csum)(struct net_device *);
  396.     int    (*set_rx_csum)(struct net_device *, u32);
  397.     u32    (*get_tx_csum)(struct net_device *);
  398.     int    (*set_tx_csum)(struct net_device *, u32);
  399.     u32    (*get_sg)(struct net_device *);
  400.     int    (*set_sg)(struct net_device *, u32);
  401.     u32    (*get_tso)(struct net_device *);
  402.     int    (*set_tso)(struct net_device *, u32);
  403.     void    (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
  404.     void    (*get_strings)(struct net_device *, u32 stringset, u8 *);
  405.     int    (*phys_id)(struct net_device *, u32);
  406.     void    (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
  407.     int    (*begin)(struct net_device *);
  408.     void    (*complete)(struct net_device *);
  409.     u32     (*get_ufo)(struct net_device *);
  410.     int     (*set_ufo)(struct net_device *, u32);
  411.     u32     (*get_flags)(struct net_device *);
  412.     int     (*set_flags)(struct net_device *, u32);
  413.     u32     (*get_priv_flags)(struct net_device *);
  414.     int     (*set_priv_flags)(struct net_device *, u32);
  415.     int    (*get_sset_count)(struct net_device *, int);
  416.  
  417.     /* the following hooks are obsolete */
  418.     int    (*self_test_count)(struct net_device *);/* use get_sset_count */
  419.     int    (*get_stats_count)(struct net_device *);/* use get_sset_count */
  420.     int    (*get_rxhash)(struct net_device *, struct ethtool_rxnfc *);
  421.     int    (*set_rxhash)(struct net_device *, struct ethtool_rxnfc *);
  422. };
  423. #endif /* __KERNEL__ */
  424.  
  425. /* CMDs currently supported */
  426. #define ETHTOOL_GSET        0x00000001 /* Get settings. */
  427. #define ETHTOOL_SSET        0x00000002 /* Set settings. */
  428. #define ETHTOOL_GDRVINFO    0x00000003 /* Get driver info. */
  429. #define ETHTOOL_GREGS        0x00000004 /* Get NIC registers. */
  430. #define ETHTOOL_GWOL        0x00000005 /* Get wake-on-lan options. */
  431. #define ETHTOOL_SWOL        0x00000006 /* Set wake-on-lan options. */
  432. #define ETHTOOL_GMSGLVL        0x00000007 /* Get driver message level */
  433. #define ETHTOOL_SMSGLVL        0x00000008 /* Set driver msg level. */
  434. #define ETHTOOL_NWAY_RST    0x00000009 /* Restart autonegotiation. */
  435. #define ETHTOOL_GLINK        0x0000000a /* Get link status (ethtool_value) */
  436. #define ETHTOOL_GEEPROM        0x0000000b /* Get EEPROM data */
  437. #define ETHTOOL_SEEPROM        0x0000000c /* Set EEPROM data. */
  438. #define ETHTOOL_GCOALESCE    0x0000000e /* Get coalesce config */
  439. #define ETHTOOL_SCOALESCE    0x0000000f /* Set coalesce config. */
  440. #define ETHTOOL_GRINGPARAM    0x00000010 /* Get ring parameters */
  441. #define ETHTOOL_SRINGPARAM    0x00000011 /* Set ring parameters. */
  442. #define ETHTOOL_GPAUSEPARAM    0x00000012 /* Get pause parameters */
  443. #define ETHTOOL_SPAUSEPARAM    0x00000013 /* Set pause parameters. */
  444. #define ETHTOOL_GRXCSUM        0x00000014 /* Get RX hw csum enable (ethtool_value) */
  445. #define ETHTOOL_SRXCSUM        0x00000015 /* Set RX hw csum enable (ethtool_value) */
  446. #define ETHTOOL_GTXCSUM        0x00000016 /* Get TX hw csum enable (ethtool_value) */
  447. #define ETHTOOL_STXCSUM        0x00000017 /* Set TX hw csum enable (ethtool_value) */
  448. #define ETHTOOL_GSG        0x00000018 /* Get scatter-gather enable
  449.                         * (ethtool_value) */
  450. #define ETHTOOL_SSG        0x00000019 /* Set scatter-gather enable
  451.                         * (ethtool_value). */
  452. #define ETHTOOL_TEST        0x0000001a /* execute NIC self-test. */
  453. #define ETHTOOL_GSTRINGS    0x0000001b /* get specified string set */
  454. #define ETHTOOL_PHYS_ID        0x0000001c /* identify the NIC */
  455. #define ETHTOOL_GSTATS        0x0000001d /* get NIC-specific statistics */
  456. #define ETHTOOL_GTSO        0x0000001e /* Get TSO enable (ethtool_value) */
  457. #define ETHTOOL_STSO        0x0000001f /* Set TSO enable (ethtool_value) */
  458. #define ETHTOOL_GPERMADDR    0x00000020 /* Get permanent hardware address */
  459. #define ETHTOOL_GUFO        0x00000021 /* Get UFO enable (ethtool_value) */
  460. #define ETHTOOL_SUFO        0x00000022 /* Set UFO enable (ethtool_value) */
  461. #define ETHTOOL_GGSO        0x00000023 /* Get GSO enable (ethtool_value) */
  462. #define ETHTOOL_SGSO        0x00000024 /* Set GSO enable (ethtool_value) */
  463. #define ETHTOOL_GFLAGS        0x00000025 /* Get flags bitmap(ethtool_value) */
  464. #define ETHTOOL_SFLAGS        0x00000026 /* Set flags bitmap(ethtool_value) */
  465. #define ETHTOOL_GPFLAGS        0x00000027 /* Get driver-private flags bitmap */
  466. #define ETHTOOL_SPFLAGS        0x00000028 /* Set driver-private flags bitmap */
  467.  
  468. #define    ETHTOOL_GRXFH        0x00000029 /* Get RX flow hash configuration */
  469. #define    ETHTOOL_SRXFH        0x0000002a /* Set RX flow hash configuration */
  470.  
  471. /* compatibility with older code */
  472. #define SPARC_ETH_GSET        ETHTOOL_GSET
  473. #define SPARC_ETH_SSET        ETHTOOL_SSET
  474.  
  475. /* Indicates what features are supported by the interface. */
  476. #define SUPPORTED_10baseT_Half        (1 << 0)
  477. #define SUPPORTED_10baseT_Full        (1 << 1)
  478. #define SUPPORTED_100baseT_Half        (1 << 2)
  479. #define SUPPORTED_100baseT_Full        (1 << 3)
  480. #define SUPPORTED_1000baseT_Half    (1 << 4)
  481. #define SUPPORTED_1000baseT_Full    (1 << 5)
  482. #define SUPPORTED_Autoneg        (1 << 6)
  483. #define SUPPORTED_TP            (1 << 7)
  484. #define SUPPORTED_AUI            (1 << 8)
  485. #define SUPPORTED_MII            (1 << 9)
  486. #define SUPPORTED_FIBRE            (1 << 10)
  487. #define SUPPORTED_BNC            (1 << 11)
  488. #define SUPPORTED_10000baseT_Full    (1 << 12)
  489. #define SUPPORTED_Pause            (1 << 13)
  490. #define SUPPORTED_Asym_Pause        (1 << 14)
  491. #define SUPPORTED_2500baseX_Full    (1 << 15)
  492.  
  493. /* Indicates what features are advertised by the interface. */
  494. #define ADVERTISED_10baseT_Half        (1 << 0)
  495. #define ADVERTISED_10baseT_Full        (1 << 1)
  496. #define ADVERTISED_100baseT_Half    (1 << 2)
  497. #define ADVERTISED_100baseT_Full    (1 << 3)
  498. #define ADVERTISED_1000baseT_Half    (1 << 4)
  499. #define ADVERTISED_1000baseT_Full    (1 << 5)
  500. #define ADVERTISED_Autoneg        (1 << 6)
  501. #define ADVERTISED_TP            (1 << 7)
  502. #define ADVERTISED_AUI            (1 << 8)
  503. #define ADVERTISED_MII            (1 << 9)
  504. #define ADVERTISED_FIBRE        (1 << 10)
  505. #define ADVERTISED_BNC            (1 << 11)
  506. #define ADVERTISED_10000baseT_Full    (1 << 12)
  507. #define ADVERTISED_Pause        (1 << 13)
  508. #define ADVERTISED_Asym_Pause        (1 << 14)
  509. #define ADVERTISED_2500baseX_Full    (1 << 15)
  510.  
  511. /* The following are all involved in forcing a particular link
  512.  * mode for the device for setting things.  When getting the
  513.  * devices settings, these indicate the current mode and whether
  514.  * it was foced up into this mode or autonegotiated.
  515.  */
  516.  
  517. /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
  518. #define SPEED_10        10
  519. #define SPEED_100        100
  520. #define SPEED_1000        1000
  521. #define SPEED_2500        2500
  522. #define SPEED_10000        10000
  523.  
  524. /* Duplex, half or full. */
  525. #define DUPLEX_HALF        0x00
  526. #define DUPLEX_FULL        0x01
  527.  
  528. /* Which connector port. */
  529. #define PORT_TP            0x00
  530. #define PORT_AUI        0x01
  531. #define PORT_MII        0x02
  532. #define PORT_FIBRE        0x03
  533. #define PORT_BNC        0x04
  534.  
  535. /* Which transceiver to use. */
  536. #define XCVR_INTERNAL        0x00
  537. #define XCVR_EXTERNAL        0x01
  538. #define XCVR_DUMMY1        0x02
  539. #define XCVR_DUMMY2        0x03
  540. #define XCVR_DUMMY3        0x04
  541.  
  542. /* Enable or disable autonegotiation.  If this is set to enable,
  543.  * the forced link modes above are completely ignored.
  544.  */
  545. #define AUTONEG_DISABLE        0x00
  546. #define AUTONEG_ENABLE        0x01
  547.  
  548. /* Wake-On-Lan options. */
  549. #define WAKE_PHY        (1 << 0)
  550. #define WAKE_UCAST        (1 << 1)
  551. #define WAKE_MCAST        (1 << 2)
  552. #define WAKE_BCAST        (1 << 3)
  553. #define WAKE_ARP        (1 << 4)
  554. #define WAKE_MAGIC        (1 << 5)
  555. #define WAKE_MAGICSECURE    (1 << 6) /* only meaningful if WAKE_MAGIC */
  556.  
  557. /* L3-L4 network traffic flow types */
  558. #define    TCP_V4_FLOW    0x01
  559. #define    UDP_V4_FLOW    0x02
  560. #define    SCTP_V4_FLOW    0x03
  561. #define    AH_ESP_V4_FLOW    0x04
  562. #define    TCP_V6_FLOW    0x05
  563. #define    UDP_V6_FLOW    0x06
  564. #define    SCTP_V6_FLOW    0x07
  565. #define    AH_ESP_V6_FLOW    0x08
  566.  
  567. /* L3-L4 network traffic flow hash options */
  568. #define    RXH_DEV_PORT    (1 << 0)
  569. #define    RXH_L2DA    (1 << 1)
  570. #define    RXH_VLAN    (1 << 2)
  571. #define    RXH_L3_PROTO    (1 << 3)
  572. #define    RXH_IP_SRC    (1 << 4)
  573. #define    RXH_IP_DST    (1 << 5)
  574. #define    RXH_L4_B_0_1    (1 << 6) /* src port in case of TCP/UDP/SCTP */
  575. #define    RXH_L4_B_2_3    (1 << 7) /* dst port in case of TCP/UDP/SCTP */
  576. #define    RXH_DISCARD    (1 << 31)
  577.  
  578.  
  579. #endif /* _LINUX_ETHTOOL_H */
  580.